package structure.Decorator;

import java.math.BigDecimal;

/**
 * Created by LYJ on 2016/10/19.
 * 具体装饰角色
 */
public class Egg extends Condiment {
    private Pancake pancake;

    public Egg(Pancake pancake) {
        this.pancake = pancake;
    }

    @Override
    public String getName() {
        return pancake.getName()+"，加鸡蛋";
    }

    @Override
    public BigDecimal getPrice() {
        return pancake.getPrice().add(new BigDecimal(1.5));
    }
}
